package com.shop.shop_end.controller;

import com.shop.shop_end.entity.Cate;
import com.shop.shop_end.entity.Good;
import com.shop.shop_end.service.CateService;
import com.shop.shop_end.service.GoodService;
import com.shop.shop_end.utils.PageHelper;
import com.shop.shop_end.utils.result.Result;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author
 * @since 2024-04-23
 */
@RestController
@RequestMapping("/good")
public class GoodController extends BaseController{
    @Resource
    private GoodService goodService;
    @Resource
    private CateService cateService;

    // 更新数据
    @RequestMapping("/updateGoods")
    public Result updateGoods(@RequestBody Good good) {
        return this.goodService.updateGood(good);
    }

    // 添加数据
    @RequestMapping("/addGood")
    public Result addGoods(@RequestBody Good good) {
        return this.goodService.addOneGood(good);
    }
}
